package education.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import education.dao.ArticleDao;
import education.model.Article;
import education.service.ArticleManager;

@Component("articleManager")
public class ArticleManagerImpl implements ArticleManager {
	private ArticleDao articleDao;

	public ArticleDao getArticleDao() {
		return articleDao;
	}

	@Resource
	public void setArticleDao(ArticleDao articleDao) {
		this.articleDao = articleDao;
	}

	public void delete(Article article) {
		articleDao.delete(article);
	}

	public boolean delete(int id) {
		articleDao.delete(id);
		return false;
	}

	public int getCount() {
		return articleDao.getCount();
	}

	public Article loadById(int id) {

		return articleDao.loadById(id);
	}

	public List<Article> paging(int pageSize, int pageCount, int rowCount) {	
		return articleDao.paging(pageSize, pageCount, rowCount);
	}

	public void save(Article article) {
		articleDao.save(article);
	}

	public boolean update(Article article) {
		return articleDao.update(article);
	}

}
